import { ApiCall } from "tsrpc";
import { ReqLook, ResLook } from "../../../shared/master/word/PtlLook";
import { player } from "../../../model/fight/body/player";
import { template } from "../../../shared/master/MsgAction";

export default async function (call: ApiCall<ReqLook, ResLook>) {
    call.succ({})
    let user = call.req._player as player;
    let _cell = user.getPosition();
    let tagBody = _cell.get_Body_index(call.req.idx - 1);
    if(!tagBody){
        user.sendMsg(template.default,`未在当前位置侦查到ID${call.req.idx}的单位`)
        return;
    }
    let tpl = tagBody.getMsgAttTpl()
    user.sendMsg(tpl.template,tpl.data);
}